package com.longxi.gamer_base.utils;

import android.content.Context;
import android.content.DialogInterface;

import com.longxi.gamer_base.dialog.WarnEditDialog;
import com.longxi.gamer_base.listener.WarnEditListener;

/**
 * Created by cxw on & 2018/8/14
 */
public class DialogEditUtils {

    WarnEditListener listener;
    Context context;

    public DialogEditUtils(Context context, WarnEditListener listener) {
        this.context = context;
        this.listener = listener;
    }

    public void dialog(){
        WarnEditDialog.Builder builder = new WarnEditDialog.Builder(context);
        builder.setMessage("取消看房")
        .setHint("请说明取消看房原因")
        .setNegativeButton("否", new DialogInterface.OnClickListener() {
            @Override public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        })
        .setPositionButton("是", listener)
        .create()
        .show();
    }

    public void dialog2(String content){
        WarnEditDialog.Builder builder = new WarnEditDialog.Builder(context);
        builder.setMessage("备注")
        .setHint("请输入备注")
        .setContent(content)
        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
            @Override public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        })
        .setPositionButton("完成", listener)
        .create()
        .show();
    }
}
